package com.zhuang.chapter14.work01;

public class StudentTest {

	public static void main(String[] args) {
		Student s1 = new Student("张三", 18);

		Student s2 = new Student("李四", 30);

		if (getMax(s1, s2) < 0) {
			System.out.println("年龄大的是->" + s2);
		} else {
			System.out.println("年龄大的是->" + s1);
		}
	}

	public static int getMax(Comparable<Student> c1, Comparable<Student> c2) {
		return c1.compareTo((Student) c2);
	}

}
